/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.iftk.xmlparser.domain;

/**
 *
 * @author treiman
 */
public class Person extends BubbleItem {
    private String firstName;
    private String lastName;
    private String title;
    private String room;
    private String phone;

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getRoom() {
        return room;
    }

    public void setRoom(String room) {
        this.room = room;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getName() {
        StringBuilder result = new StringBuilder();
        
        result.append(firstName);
        result.append(" ");
        result.append(lastName);
        
        return result.toString();
    }
    
    @Override
    public String toString() {
        StringBuilder result = new StringBuilder();
        String NEW_LINE = System.getProperty("line.separator");
        
        result.append(this.getClass().getName()).append("Object {").append(NEW_LINE);
        result.append(" ID: ").append(getId()).append(NEW_LINE);
        result.append(" Firstname: ").append(firstName).append(NEW_LINE);
        result.append(" Lastname: ").append(lastName).append(NEW_LINE);
        result.append(" Title: ").append(title).append(NEW_LINE);
        result.append(" Room: ").append(room).append(NEW_LINE);
        result.append(" Phone: ").append(phone).append(NEW_LINE);
        result.append("}");
        
        return result.toString();
    }
    
    @Override
    public String toBubble() {
        StringBuilder result = new StringBuilder();
        String NEW_LINE = System.getProperty("line.separator");
        
        result.append("<bubble>").append(NEW_LINE);
        result.append("\t<id>").append(getId()).append("</id>").append(NEW_LINE);
        result.append("\t<titletext>").append(getFirstName()).append(" ").
                append(getLastName()).append("</titletext>").append(NEW_LINE);
        result.append("\t<titlefontsize>10</titlefontsize>").append(NEW_LINE);
        result.append("\t<shorttext fontsize=\"3\">").append(getFirstName()).append(" ").
                append(getLastName()).append(NEW_LINE).append(getTitle()).
                append(NEW_LINE).append(getRoom()).append(NEW_LINE).
                append(getPhone()).append("</shorttext>").append(NEW_LINE);
        result.append("\t<style>Pink</style>").append(NEW_LINE);
        result.append("\t<links></links>").append(NEW_LINE);
        result.append("\t<priority>3</priority>").append(NEW_LINE);
        result.append("</bubble>").append(NEW_LINE);
        
        return result.toString();
    }
}
